package cn.xfdzx.android.apps.shop.activity.login;

import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;


import androidx.annotation.Nullable;

import butterknife.BindView;
import butterknife.OnClick;
import cn.xfdzx.android.apps.shop.R;
import cn.xfdzx.android.apps.shop.base.BaseMvpActivity;
import cn.xfdzx.android.apps.shop.presenter.OneLoginPresenter;

/*
/*   废弃的一键登录页面
 */
public class OneClickLoginActivity extends BaseMvpActivity<OneLoginPresenter> {

    @BindView(R.id.iv_back)
    ImageView ivBack;      //标题栏-左边按钮



    @BindView(R.id.tv_oneclick_phone)
    TextView tvOneclickPhone;   //一键登录页面手机号显示
    @BindView(R.id.tv_oneclick_login)
    TextView tvOneclickLogin;    //一键登录按钮
    @BindView(R.id.tv_oneclick_mobile)
    TextView tvOneclickMobile;   //其他手机登录按钮
    @BindView(R.id.tv_oneclick_agreement)
    TextView tvOneclickAgreement;   //用户协议
    @BindView(R.id.tv_oneclick_privacy)
    TextView tvOneclickPrivacy;    //隐私权限
    @BindView(R.id.tv_oneclick_wx_login)
    ImageView tvOneclickWxLogin;   //微信登录
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);


        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = getWindow();
            window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
                    | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
            window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(Color.TRANSPARENT);

        }

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_oneclicklogin;
    }

    @Override
    public void initView() {

    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void onError(Throwable throwable) {

    }

    @OnClick({R.id.iv_back, R.id.tv_oneclick_login, R.id.tv_oneclick_mobile, R.id.tv_oneclick_agreement, R.id.tv_oneclick_privacy, R.id.tv_oneclick_wx_login})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_back:     //左上角关闭页面图标
                finish();
                break;
            case R.id.tv_oneclick_login:  //一键登录按钮
//                Holder.with().setEnableSenseBot(true);
//                oneLoginUtils.setSenseBotEnable(true);
//                Holder.with().setOneLoginStyle(Constants.ONELOGIN_FULLSCREEN_MODE);
//                if (OneLoginHelper.with().isPreGetTokenResultValidate()) {
//                    oneLoginUtils.requestToken();
//                    return;
//                }

                break;
            case R.id.tv_oneclick_mobile: //其他手机号登录按钮

                startActivity(new Intent(this, MobileLoginActivity.class));
                break;
            case R.id.tv_oneclick_agreement:  //用户协议点击
                break;
            case R.id.tv_oneclick_privacy:  //隐私权限点击
                break;
            case R.id.tv_oneclick_wx_login:  //微信登录点击


                break;
        }

    }


}
